import Vue from 'vue'
import App from './App'
import * as RongIMLib from '@rongcloud/imlib-next'
//使用vuex
import store from './store/index.js'
import utilim from './utils/RongIM.js'

Vue.prototype.utilim = utilim
Vue.prototype.$store = store
// 封装方法
import * as util from '@/common/util.js';
Vue.prototype.util = util;
import base_url from 'common/config.js'
//图片上传
Vue.prototype.$uploadUrl = base_url.upload_url
Vue.prototype.$getimgsrc = function(url) {
  let urlk = url;
  let str = RegExp('http');
  let newUrl;
  //通过三元运算符进行判断该图片是否含有http域名，没有就拼接上去
  str.test(urlk) ? newUrl = urlk : newUrl = base_url.img_url + urlk;
  const urls = newUrl
  return urls
}
import {
  http
} from "@/utils/http.js"
Vue.config.productionTip = false
Vue.prototype.IM = RongIMLib
Vue.prototype.http = http
Vue.prototype.img_url = 'https://wndz-oss.oss-cn-beijing.aliyuncs.com'
App.mpType = 'app'

const app = new Vue({
  ...App
})
app.$mount()